package com.th.supcom.pds.internal.api.phamapply;

import java.util.List;
import java.util.Map;

import com.th.supcom.pds.domain.pojo.DeptVsDispensary;
import com.th.supcom.pds.domain.pojo.InpPhamApplyDetail;
import com.th.supcom.pds.domain.pojo.InpPhamApplyDetailSummary;
import com.th.supcom.pds.domain.pojo.InpPhamApplyMaster;
import com.th.supcom.pds.domain.pojo.InpPhamApplyPatInfo;
import com.th.supcom.pds.domain.vo.InpPhamApplyDetailVO;

/**
 * 住院摆药请领单服务
 * 
 * @author 王剑
 */
public interface PhamApplyService
{

    /**
     * 生成摆药请领明细
     * 
     * @param inpPhamApplyMaster
     * @return
     */
    public List <InpPhamApplyDetailVO> generatePhamApplyDetailList (List <InpPhamApplyPatInfo> patInfos, InpPhamApplyMaster inpPhamApplyMaster,
                                                                    String repetition);

    /**
     * 保存住院摆药请领主表和明细
     * 
     * @param inpPhamApplyMaster
     * @param detailList
     */
    public void savePhamApplyMasterAndDetail (InpPhamApplyMaster inpPhamApplyMaster, List <InpPhamApplyDetailVO> detailList);

    /**
     * 根据护理单元查询需要摆药的在院患者信息
     * 
     * @param nurseUnitCode
     * @return
     */
    public List <InpPhamApplyPatInfo> getApplyPatInfosByNurseUnit (String nurseUnitCode);

    /**
     * 根据本次请领的药品查询可冲抵的药品汇总
     * 
     * @param summaryList
     * @return
     */
    public List <InpPhamApplyDetailVO> getOffsetPhamSummaryList (List <InpPhamApplyDetailSummary> summaryList);

    /**
     * 根据护理单元查询可冲抵药品
     * @param summaryList
     * @return
     */
    public List <InpPhamApplyDetailVO> getOffsetPhamList (List <InpPhamApplyDetailSummary> summaryList);
    /**
     * 批量保存请领信息
     * 
     * @param details
     */
    public void saveInpPhamApplyDetailList (List <InpPhamApplyDetail> details);
    
    /**
     * 判断当前时间是否为夜班
     * @param deptCode
     * @return ture 为夜班，false 不是夜班
     */
    public boolean isNightShift(String deptCode, Map <String, List <DeptVsDispensary>> shiftDispensaryMap);

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, XuNuo Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";
}
